<%-- 
    Document   : form
    Created on : Jul 3, 2013, 4:31:47 PM
    Author     : dante.panella
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="com.myapp.struts.login"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
         <!--<form action="registro.do" method="post">
            <input type="text" name="user" /><br/>
            <input type="pass" name="pass" /><br/>
            <input type="submit" value="enviar" /><br/>
            
        </form> -->
        
        <html:form action="/registro" focus="nombre" >
            
            <bean:message key="formulario.nombre"/> <html:text property="nombre" /><br/>
            <bean:message key="formulario.apellido"/> <html:text property="apellido" /><br/>
            
            <bean:message key="formulario.edad"/>
            <html:select property="edad">
                <html:option value="menor de 20" key="1" />
                <html:option value="menor de 30" key="2" />
                <html:option value="menor de 50" key="3" />
                <html:option value="mayor de 50" key="4" />
                
            </html:select><br/>
                        
            <bean:message key="formulario.pass"/> <html:password property="pass" /><br/>
            
            <html:submit>
                <bean:message key="Button.submit"/>
            </html:submit>
            
        </html:form>
        
        <html:errors/>    
            
        <br/>
        <% 
            ArrayList lista;
            if(request.getAttribute("error") != null)
            {
                lista = (ArrayList)request.getAttribute("error");
                for(int i =0; i< lista.size(); i++ )
                {
                    out.println(lista.get(i) + "<br/>");
                }
            }
            
            
            
        %>
       
    </body>
</html>
